package com.sl.hx.shop.ui.mine.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sl.hx.shop.R;
import com.sl.hx.shop.bean.MessageBean;
import com.sl.hx.shop.utils.TimeUtil;

import java.util.List;

public class MessageAdapter extends BaseQuickAdapter<MessageBean,BaseViewHolder> {

    public MessageAdapter(@Nullable List<MessageBean> data) {
        super(R.layout.item_message,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MessageBean item) {
        ImageView imageView = helper.getView(R.id.icon);
        Glide.with(mContext).load(item.getLogo()).into(imageView);

        helper.setText(R.id.title,item.getName())
        .setText(R.id.message,item.getDescript())
                .setText(R.id.time, TimeUtil.getDateToString(item.getLasttime()*1000));


    }
}
